package com.movieSystem.view;

import javafx.embed.swing.JFXPanel;
import javafx.scene.image.Image;
import tcpFirmware.OKClient;
import tcpFirmware.model.DBHelper;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class SelectView {
    public static void main(String[] args) {
//        new JFXPanel();
//        Connection connection1 = new DBHelper().getConnection();
//        try {
//            Statement statement = connection1.createStatement();
//            ResultSet rs = statement.executeQuery("select * from Movie where name='流浪地球'");
//            rs.next();
//            File file = new File(rs.getString("img"));
//            System.out.println(file.getPath());
//            Image image = new Image(file.toURI().toURL().toString());
//            SeatChooser.open(image,"流浪地球","第一场","二号厅","19.80","qhz");
//        } catch (MalformedURLException | SQLException e) {
//            e.printStackTrace();
//        }

//        byte[] bytes=OKClient.downloadImage("src/tcpFirmware/image/复仇者联盟.jpg");
//        try {
//            FileOutputStream outputStream = new FileOutputStream("F:\\AlljavaProjects\\复仇者联盟.jpg");
//            outputStream.write(bytes);
//            outputStream.flush();
//            outputStream.close();
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
    }

}
